Back to Contents        Previous        Next



30. Wimp messaging system

The Wimp’s messaging system is a means used by the Wimp to manage multi-tasking applications effectively. It is particularly important for handling file tranfers e.g. saving/loading/printing. The DrWimp library routinely receives all these messages and acts automatically on many of them, but does not (yet?) use them all.

For the vast majority of circumstances this messaging system will be entirely hidden from Dr Wimp users (that’s the whole point!) but for some advanced operations it can be useful for any messages that are received by your application but unused by the DrWimp library to be passed on to the programmer via a user-function.

This is DEF PROCuser_wimpmessage(messagenumber%,block%,reasoncode%). When it is called, the unused wimp-message number will be in the first parameter and the second parameter will give the address of the memory block holding associated data. (If you know enough to use this facility you will know how to use the second and third parameters!) The final parameter will hold the reason code passed by the wimp poll and this will be either 17, 18 or 19 in these cases.

Because there are frequent wimp-messages and because it will not be a frequently used facility, the option to pass on the unused messages is provided with an ‘on/off switch’ - and this is set to its default value of ‘off’ at application start-up.

The ‘switch’ is controlled very simply by the special global variable UNUSED%. This is set to FALSE within FNwimp_initialise, on application start-up, but you can set it to TRUE at anytime after that (including within PROCuser_initialise, if you wish).

During any time that UNUSED%=TRUE the message number of any wimp-messages received but not used within the DrWimp library will be passed via PROCuser_wimpmessage for you to detect and act upon if you so wish.

For your information, the current version of the DrWimp library uses the following wimp-messages, so these values will never be passed via PROCuser_wimpmessage:

0                           Quit
&1                           DataSave
&2                           DataSaveAck
&3                           DataLoad
&4                           DataLoadAck
&5                           DataOpen
&8                           PreQuit
&A                           SaveDesktop
&502                  HelpRequest
&400C0                  MenuWarning
&400C1                  ModeChange
&400CC                  WindowInf
&47700                  ColourPickerColourChoice
&47702                  ColourPickerCloseDialogueRequest
&80147                  SetPrinter







Top of page        Back to Contents        Previous        Next